package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.pojo.TbContentCategory;
import com.dongdongshop.service.TbContentCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbContentCategoryServiceImpl implements TbContentCategoryService {

    @Autowired
    private TbContentCategoryMapper categoryMapper;

    @Override
    public List<TbContentCategory> selectss() {
        List<TbContentCategory> tbContentCategories = categoryMapper.selectByExample(null);
        return tbContentCategories;
    }

    @Override
    public void deleteByid(Long[] ids) {
        categoryMapper.deleteByids(ids);
    }

    @Override
    public Boolean insertinto(TbContentCategory category) {
        int i = categoryMapper.insertSelective(category);
        return i>0;
    }

    @Override
    public TbContentCategory toupdata(Long id) {
        TbContentCategory tbContentCategory = categoryMapper.selectByPrimaryKey(id);
        return tbContentCategory;
    }

    @Override
    public Boolean updatas(TbContentCategory category) {
        int i = categoryMapper.updateByPrimaryKeySelective(category);
        return i>0;
    }
}
